class Solution(object):
    def maxArea(self, h, w, horizontalCuts, verticalCuts):
        horizontalCuts.sort()
        verticalCuts.sort()
        max_h = horizontalCuts[0]
        for i in range(1, len(horizontalCuts)):
            max_h = max(max_h, horizontalCuts[i] - horizontalCuts[i - 1])
        max_h = max(max_h, h - horizontalCuts[-1])
        max_v = verticalCuts[0]
        for i in range(1, len(verticalCuts)):
            max_v = max(max_v, verticalCuts[i] - verticalCuts[i - 1])
        max_v = max(max_v, w - verticalCuts[-1])
        return max_h * max_v % (10 ** 9 + 7)
